﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XemThemTinTuc.aspx.cs" Inherits="WebHousingInfo.XemThemTinTuc" %>

<%@ Register Src="~/Controls/Header.ascx" TagName="Header1" TagPrefix="Header" %>
<%@ Register Src="~/Controls/Timkiemtrentrangchu.ascx" TagName="TK" TagPrefix="Timkiemtrentrangchu" %>
<%@ Register Src="~/Controls/NhaDatBanChoThueHaiNamMuoiTrai.ascx" TagName="tm" TagPrefix="NhaDatBanChoThueHaiNamMuoiTrai" %>
<%@ Register Src="~/Controls/Quangcaotrangchutrai.ascx" TagName="qc" TagPrefix="Quangcaotrangchutrai" %>
<%@ Register Src="~/Controls/Quangcaophai.ascx" TagName="qcPHAI" TagPrefix="Quangcaophai" %>
<%@ Register Src="~/Controls/KhongGianSong.ascx" TagName="KGS" TagPrefix="KhongGianSong" %>
<%@ Register Src="~/Controls/MenuFooter.ascx" TagName="MN" TagPrefix="MenuFooter" %>
<%@ Register Src="~/Controls/Footer.ascx" TagName="FT" TagPrefix="Footer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Danh sách tin tức tổng hợp</title>
</head>
<body>
    <form id="form1" runat="server">
        <div id="uni_wrapper">
            <Header:Header1 ID="Header" runat="server" />
	        <div id="uni_main">
		        <div id="content" class="clearfix">
		        <% string modecates = Request.QueryString["idcate"];
                    int idcategory = Convert.ToInt32(modecates);
                    var objectcate = HousingInfo.Library.CategoryBO.GetCategoryBO(idcategory);      
		        %>
			        <div id="group_6">
				        <div id="group_7">	
					        <Timkiemtrentrangchu:TK ID="Timkiemtrentrangchu" runat="server" />
					        <NhaDatBanChoThueHaiNamMuoiTrai:tm ID="NhaDatBanChoThueHaiNamMuoiTrai" runat="server" />
					        <Quangcaotrangchutrai:qc ID="Quangcaotrangchutrai" runat="server" />
					        <!---->
				        </div>
				        <div id="group_4">
				        <!--b danh sach tinh-->
				            <div class="box02_title">
					            <table cellspacing="5" cellpadding="1" border="0">
						            <tbody>
						                <tr valign="bottom">
							                <td><a href="Home.aspx">
								                <img border="0" alt="Go Back" src="Admin/img/navbits_start.gif" title="Go Back"></a>
							                </td>
							                <td>&nbsp;</td>
							                <td width="100%">
								                <span class="navbar"><a accesskey="1" href="Home.aspx">Trang chủ</a></span>
                                                <span class="navbar">&gt; 
                                                    <a href="#"><%=objectcate.CategoryName %></a>
                                                </span>  
							                </td>
						                </tr>
					                </tbody>
					            </table>
				            </div>
					        <div id="danhsachtin">
					        <% 
                                var objectnoithat = getdatasource();
                            foreach (var obnoithat in objectnoithat)
                            {%>
						        <div class="one_news">
						        <% if (obnoithat.UrlImage != "")
                                     {
                                         if (checkurlimage(obnoithat.UrlImage) == true)
                                         {
                                             string url = "TotalUpload/ImagesTotal/" + obnoithat.UrlImage;
                                              %>
                                                <a href="ChiTietTinTuc.aspx?idnews=<%=obnoithat.NewsID %>&idcate=<%=obnoithat.CategoryID %>"><img src="<%=url %>" width="130" height="130px" border="0" align="left" /></a>
                                         <%} else {%>
                                                 <a href="#"><img src="TotalUpload/ImagesTotal/noimage.gif" width="130" height="130px" border="0" align="left" /></a>
                                        <% }
                                     }
                                 else
                                 {%>
                                     <a href="ChiTietTinTuc.aspx?idnews=<%=obnoithat.NewsID %>&idcate=<%=obnoithat.CategoryID %>"><img src="TotalUpload/ImagesTotal/noimage.gif" width="130px" height="130px" border="0" align="left" /></a>
                                <%}%>
							            <div class="content">
								            <div class="title"><p><a href="ChiTietTinTuc.aspx?idnews=<%=obnoithat.NewsID %>&idcate=<%=obnoithat.CategoryID %>"><%=obnoithat.Title %></a></p><span><a href="ChiTietTinTuc.aspx?idnews=<%=obnoithat.NewsID %>&idcate=<%=obnoithat.CategoryID %>">chi tiết</a></span></div>
								            <div class="data">
								            <% if (obnoithat.NewsContent.Length > 150)
                                       { %>
                                     <%=obnoithat.NewsContent.Substring(0, 149)%> ...
                                    <%}
                                       else
                                       { %>
                                    <%=obnoithat.NewsContent%>
                                    <%} %></div>
							            </div>
						        </div>	
						        <%} %>								
					        </div>
					        <div id="link">
				                <asp:Label ID="lblpaging" runat="server" Text=""></asp:Label>
			                </div>
					        <div style="margin-bottom:10px"></div>
					        <div id="tinkhac">
						        <% var oborthercate = HousingInfo.Library.CategoryBOList.GetCategoryBO_ByOrtherCurrentID(idcategory);
                                var obnewother = HousingInfo.Library.NewsBOList.GetNewsBOList_ByNoiThat(oborthercate[0].CategoryID, 5);%>					        
						        <div class="title">CÁC TIN CHỦ ĐỀ KHÁC</div>   
						        <% foreach(var obnews in obnewother)
                                { %>
						        <div class="content">
							        <ul>
								        <li><a href="ChiTietTinTuc.aspx?idnews=<%=obnews.NewsID %>&idcate=<%=obnews.CategoryID %>"><%=obnews.Title %></a></li>
							        </ul>
						        </div>
						        <%} %>
						        <div class="footer"><a href="XemThemTinTuc.aspx?idcate=<%=oborthercate[0].CategoryID %>">xem tiếp</a></div>
					        </div>
				        </div>
			        </div>			
			        <div id="group_5">
				    <Quangcaophai:qcPHAI ID="Quangcaophai" runat="server" />
			        <!--B khong gian song-->					
			        <KhongGianSong:KGS ID="KhongGianSong" runat="server" />
	                <!--e khong gian song-->			
			        </div>
		        </div>
	        </div>	
	        <MenuFooter:MN ID="MenuFooter" runat="server" />
	        <Footer:FT ID="Footer" runat="server" />
        </div>
    </form>
</body>
</html>
